﻿// This source is subject to Microsoft Public License (Ms-PL).
// Please see http://taskcardcreator.codeplex.com for details.
// All other rights reserved.

using System;
using System.Globalization;
using System.Windows.Data;
using Microsoft.TeamFoundation.WorkItemTracking.Client;

namespace MSFforAgileSoftwareDevelopmentv50.Converters
{
  class PointsConverter : IValueConverter
  {
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
      var workItem = value as WorkItem;
      string fieldName = "Story Points";
      if (workItem != null)
        if (workItem.Fields[fieldName].Value != null)
          return workItem.Fields[fieldName].Value.ToString();

      return "-";
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
      throw new NotImplementedException();
    }
  }
}